package com.acme.bankapp.domain.bank;

public class CheckingAccount extends AbstractAccount {
	private double overdraft;
	
	public CheckingAccount(double amount, double overdraft) {
		super(amount);
		this.overdraft = overdraft;
	}

	public void deposit(double amount) {
		balance += amount;
	}

	public void withdraw(double amount) {
		assert (balance + overdraft >= amount);
		if (balance + overdraft >= amount) {
			balance -= amount;
		}
	}

	@Override
	public double maximumAmountToWithdraw() {
		return balance + overdraft;
	}

}
